import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:framelib/utils/color_util.dart';

class NoSizeAppBar extends StatefulWidget implements PreferredSizeWidget{

  const NoSizeAppBar({
    super.key,
    this.elevation,
    this.backgroundColor,
    this.statusColor,
  });

  final double? elevation;
  final Color? backgroundColor;
  final Color? statusColor;


  @override
  _NoSizeAppBarState createState() => _NoSizeAppBarState();

  @override
  Size get preferredSize => Size.fromHeight(0);
}

class _NoSizeAppBarState extends State<NoSizeAppBar> {


  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return AnnotatedRegion<SystemUiOverlayStyle>(
      value: widget.statusColor ==Colors.white?SystemUiOverlayStyle.light:SystemUiOverlayStyle.dark,
      child: Material(
        elevation: widget.elevation??0,
        color: widget.backgroundColor??color_main,
        child: SafeArea(
          child: Container(
            width:0,
            height: 0,
          ),
        ),
      ),
    );
  }
}
